#pragma once

class CLogFile
{
public:
	CLogFile(HMODULE hModule);
	~CLogFile();

	CLogFile(const CLogFile&) = delete;
	CLogFile& operator=(const CLogFile&) = delete;

	void WriteLine(const std::string& strLine);
	void FlushCache();

private:
	void AppendData(LPCSTR lpData, size_t nSize);
	void OpenFile();

	HMODULE m_hModule;
	HANDLE  m_hFile;
	bool    m_bInited;
	int     m_nOldDate;
	SRWLOCK m_SRWLock = SRWLOCK_INIT;
	std::vector<std::string> m_vecData;
};
